﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;

namespace MVC3AppCodeFirst.Models
{
    public class UserContext : DbContext
    {

        public DbSet<Student> Students { get; set;  }
        public DbSet<Teacher> Teachers { get; set; }
        public DbSet<Course> Courses { get; set; }

        static UserContext()
        {
            Database.SetInitializer(new MyDbContextInitializer());
        }
    }

    public class MyDbContextInitializer : CreateDatabaseIfNotExists<UserContext>
    {
        protected override void Seed(UserContext dbContext)
        {
            base.Seed(dbContext);
        }
    }
}

